"use client";
import { BannerRep } from "@/api/home";
import Box from "@/components/Box";
import { Swiper } from "antd-mobile";
import { FC } from "react";
interface Props {
    notices: BannerRep[];
}
const HomeNoticeBar: FC<Props> = (props) => {
    const { notices } = props;
    console.log(`🚀🚀🚀🚀🚀-> in HomeNoticeBar.tsx on 11`, notices);
    return (
        <div className={"my-[0.0694rem] flex items-center"}>
            <div className={"iconfont icon-laba mr-[0.06rem] text-[yellow]"}></div>
            <Swiper
                direction="vertical"
                className={"text-[yellow]"}
                indicator={() => null}
                style={{ "--height": "0.4167rem" }}
                loop
                autoplay
            >
                {notices.map((notice, index) => (
                    <Swiper.Item key={index}>
                        <Box
                            none
                            action={notice.action_type}
                            className={
                                "flex h-[0.4167rem] items-center overflow-hidden" +
                                " flex-wrap text-ellipsis"
                            }
                            actionData={notice.action_params}
                        >
                            <div dangerouslySetInnerHTML={{ __html: notice.content! }}></div>
                        </Box>
                    </Swiper.Item>
                ))}
            </Swiper>
        </div>
    );
};
export default HomeNoticeBar;
